package com.ikas.ai.server.config.handler;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.extension.handlers.AbstractJsonTypeHandler;

import java.util.List;

/**
 * @Description: 字符串 <-> list<String>
 * @Author: qi.yilai
 * @Date: 2023/4/19 8:55
 * @Version: 1.0.0
 **/
public class ListStringHandler extends AbstractJsonTypeHandler<List<String>> {
    @Override
    protected List<String> parse(String json) {
        return JSON.parseArray(json, String.class);
    }

    @Override
    protected String toJson(List<String> obj) {
        return JSON.toJSONString(obj);
    }
}
